Release 10.1A: OpenEdge Reporting:
Query/Results Administration and Development
Generating new queries
You can generate new queries programmatically in Results from a feature or integration procedure. Query generation from a feature or integration procedure uses the
vstbll.pAPI procedure and some special Results features.The
vstbll.pAPI procedure allows you to set the table list for a new query in Results. You cannot run thevstbll.pAPI procedure when there is a current query in Results. If there is an active query in Results, you must execute the AdminProgInitialize feature to clear the query prior to running thevstbll.pAPI procedure. Use the following syntax to call thevstbll.pAPI procedure from a feature procedure or integration procedure:
Parameters of the vstbll.p API procedure
The following list describes the parameters associated with the
vstbll.pAPI procedure:INPUTtableListA string value containing a comma-separated list of table or alias names to establish the currently active query in Results. The tables specified must be available in the currently attached databases. If you intend to join a table to another table, you must specify both tables in the list in the order specified in the join. For example, the join
Customer OF Orderrequires that the Customer table must be listed before the Order table in the table list.OUTPUTresultA logical value that indicates whether the API procedure executed successfully.
![]()
To generate queries from a feature or integration procedure:
- Execute the AdminProgInitialize feature using the
sffire.pAPI procedure to clear the current query from Results.- Run the
vstbll.pAPI procedure to set the table list for the new query.- Define fields and format information for the new query using the API shared variables and procedures. At a minimum, set the
qbf–moduleandqbf–namevariables and define a field for the query.- Execute the AdminProgInstantiate feature using the
sffire.pAPI procedure to initialize any unset API shared variables with valid default values. You must execute this feature before you attempt to display or run the new query.- Save the new query, generate 4GL code for the query, then print it or display it in Results.
The feature procedure shown in Example 3–5 generates a new query, then displays it in Results.
The commented numbers in the code refer to these notes:
- Includes the
u-pvars.ifile to define the API shared variables for access in the procedure.- Defines the
INPUTandOUTPUTparameters required by a feature procedure.- Defines a variable to capture the output values of the different API procedures used in this feature procedure.
- Executes the AdminProgInitialize feature using the
sffire.pAPI procedure to clear the current query from Results.- Sets the table list for the new query. The example feature procedure uses tables from the sports database.
- Defines the join and selection criteria for the tables specified for the new query.
- Defines two fields for the new query.
- Instantiates the rest of the data structures of the new query in preparation for use in Results.
- Sets the output parameter of the feature procedure to
TRUE, which tells Results to redraw the window and display the new query defined in the feature procedure.For more information about the language elements used in the this example procedure, see the OpenEdge Development: Progress 4GL Reference .
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |